package com.tonghaibo.dao;

import com.tonghaibo.po.Book;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author jitwxs
 * @date 2025年04月27日 21:42
 */
public interface BookDao {
    //查询全部数据
    @Select("select * from tbl_book")
    List<Book> findAll();

    //根据id查询
    @Select("select * from tbl_book  where id=#{id}")
    Book findById(Integer id);

    //插入数据
    @Insert("insert into tbl_book values(null,#{type},#{name},#{description})")
    boolean inster(Book book);

    //删除数据
    @Delete("delete from tbl_book where id = #{id}")
    boolean delectById(Integer id);
}



